package com.xishu.entity.eft;

import com.xishu.annotation.oplog.OplogAnnotation;
import com.xishu.entity.AbstractEntity;
import com.xishu.entity.ShopItem;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

@Entity(name = "eft_config")
@Table(indexes = {@Index(columnList = "shopId")})
@Data
public class EftConfig extends ShopItem {
    private static final long serialVersionUID = -4764089484164299691L;

    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    public Long id;

    @ApiModelProperty(value = "归属的餐厅公司")
    private Long companyId;

    @ApiModelProperty(value = "餐厅名")
    @OplogAnnotation(fieldName = "餐厅名")
    private String companyName;

    @ApiModelProperty(value = "分店的ID")
    private Long shopId;

    @ApiModelProperty(value = "分店名")
    @OplogAnnotation(fieldName = "分店名")
    private String shopName;

    @ApiModelProperty(value = "分店名")
    @OplogAnnotation(fieldName = "分店名")
    @Transient
    private String shopName_zh;

    @ApiModelProperty(value = "分店名")
    @OplogAnnotation(fieldName = "分店名")
    @Transient
    private String shopName_en;

    @ApiModelProperty(value = "eft终端名称")
    private String terminalName;

    @ApiModelProperty(value = "eft终端的IP地址")
    private String ipAdress;

    public EftConfig(Long shopId) {
        this.shopId = shopId;
    }

    public EftConfig() {
    }
}
